package com.fimmlps.reronge.dto;

import com.fimmlps.reronge.entity.EntryUser;
import com.fimmlps.reronge.entity.EntryUserChat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ChatDto {

    private Integer entryUserChatId;
    private Integer chaterUserId;
    private String chaterName;
    private String chaterHeadUrl;
    private Integer chateeUserId;
    private String chateeName;

    private Integer chatType;
    private String chatContent;
    private Integer charExtraId;
    private LocalDateTime createTime;

    public ChatDto(EntryUserChat chat, EntryUser chater,EntryUser chatee){
        entryUserChatId = chat.getEntryUserChatId();
        chaterUserId = chater.getUserId();
        chaterName = chater.getUserName();
        chaterHeadUrl = chater.getUserHeadUrl();
        chateeUserId = chatee.getUserId();
        chateeName = chatee.getUserName();
        chatType = chat.getChatType();
        chatContent = chat.getChatContent();
        charExtraId = chat.getChatExtraId();
        createTime = chat.getCreateTime();
    }
}
